﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace Rename.UC.组合
{
    public partial class Uc删除字符 : UserControl
    {
        public Uc删除字符()
        {
            InitializeComponent();
            cmb删除样式.SelectedIndex = 0;
            cmb从.SelectedIndex = 0;
            rad指定内容.Checked = true;

            p2.Enabled = false;
            p3.Enabled = false;
            p3位置.Visible = false;
        }
        private void Init指定内容()
        {
            this.lbl删除内容 = new System.Windows.Forms.Label();
            this.lbl删除内容.AutoSize = true;
            this.lbl删除内容.Location = new System.Drawing.Point(10, 81);
            this.lbl删除内容.Name = "lbl删除内容";
            this.lbl删除内容.Size = new System.Drawing.Size(71, 16);
            this.lbl删除内容.TabIndex = 3;
            this.lbl删除内容.Text = "删除内容";
            this.Controls.Add(this.lbl删除内容);


            this.ucTxt删除内容 = new Rename.UC.UcTextBox();
            this.ucTxt删除内容.EmptyTextTip = "请输入删除内容";
            this.ucTxt删除内容.Location = new System.Drawing.Point(10, 110);
            this.ucTxt删除内容.Multiline = true;
            this.ucTxt删除内容.Name = "ucTxt删除内容";
            this.ucTxt删除内容.Size = new System.Drawing.Size(317, 110);
            this.ucTxt删除内容.TabIndex = 4;
            this.Controls.Add(this.ucTxt删除内容);
        }

        private void Init指定位置()
        {
        }

        private void rad指定位置_CheckedChanged(object sender, EventArgs e)
        {
            p3内容.Visible = false;
            p3位置.Visible = true;
            p3位置.Dock=DockStyle.Fill;
        }

        private void rad指定内容_CheckedChanged(object sender, EventArgs e)
        {
            p3内容.Visible = true;
            p3位置.Visible = false;
        }

        private void cmb删除样式_SelectedIndexChanged(object sender, EventArgs e)
        {
            string cmbStr = cmb删除样式.Text.Trim();
            if (cmbStr == "删除指定字符")
            {
                p2.Enabled = true;
                p3.Enabled = true;
            }
            else
            {
                p2.Enabled = false;
                p3.Enabled = false;
            }
        }
    }
}
